$(function(){
    $("title").text("物联卡详情"); 
    $("#rightMain_title").text("物联卡")
	/*获取路由器ID*/
    var location = getUrlParam("sign");
        $.ajax({
            url:"iotsim/terminalDetail",
            type:"post",
            data:{
                num: "898602B9191750169301",
                simType: "iccid",
            },
            success:function(result){
                result=JSON.parse(result);
                console.log(result)
       		 	if(result.error!=0){
    			 setTimeout(function(){
              		swal(" 查询失败！",result.message, "error");
              		window.location.href="error/error.html";
              	},0);
//    			 alert("查询失败！"+result.message);
    			 return false;
    		 }
                /*判断电源类型*/
//                if(result.result.status=="1"){
//                	var supply = "开机";
//                }else if(result.result.status=="0"){
//                	var supply = "关机";
//                }else{
//                	var supply = "未获取";
//                };
//                if(result.data[0].battery==null){
//                	var battery = "未获取";
//                }else{
//                	var battery = result.data[0].battery+"%";
//                };
//                var routerSn = result.data[0].sn+"";
                var myP = '<table id="cardTable" cellspacing="1" cellpadding="0"><tbody cellspacing="1" cellpadding="0" style="padding:0;margin:0;width:100%">'+
				 '<tr><td>ICCID</td><td>'+result.result.iccid+'</td></tr>'+
				 '<tr><td>SIM</td><td>'+result.result.sim+'</td></tr>'+
				 '<tr><td>状态</td><td>'+result.result.status_desc+'</td></tr>'+
				 '<tr><td>余额</td><td>'+result.result.balance+'元</td></tr>'+
				 '<tr><td>周期总用量</td><td>'+result.result.amount_usage+' kb</td></tr>'+
				 '<tr><td>已使用用量</td><td>'+result.result.done_usage+' kb</td></tr>'+
				 '<tr><td>剩余用量</td><td>'+result.result.surplus_usage+' kb</td></tr>'+
				 '<tr><td>开发日期</td><td>'+result.result.open_time+'</td></tr>'+
				 '<tr><td>到期日期</td><td>'+result.result.expire_date+'</td></tr>'+
				 '</tbody></table>';
                $("#cardList").prepend(myP);
//                
//
// 
            },
            error:function(err){
                console.log(err);
            }
        });
})